SELECT ORG_MEMBER."ID", FORMMAIN_1678.FIELD0002 memberCode,FORMMAIN_1678.FIELD0003 memberName,ORG_UNIT."ID" deptID,
CASE WHEN ORG_POST."ID" IS NULL THEN NULL ELSE ORG_POST."ID" END postId,(CASE WHEN FORMMAIN_1678.FIELD0005 = '2' THEN '1' ELSE '0' END) is_state,
PERSON_SECRET_LEVELS.PSL_ID pslId
FROM FORMMAIN_1678 
LEFT JOIN ORG_MEMBER ON ORG_MEMBER.CODE = FORMMAIN_1678.FIELD0002 AND ORG_MEMBER.IS_DELETED = 0   
LEFT JOIN ORG_UNIT ON ORG_UNIT.CODE = FORMMAIN_1678.FIELD0006 AND ORG_UNIT.IS_DELETED = 0
LEFT JOIN ORG_POST ON ORG_POST.CODE = FORMMAIN_1678.FIELD0007 AND ORG_POST.IS_DELETED = 0
LEFT JOIN PERSON_SECRET_LEVELS ON PERSON_SECRET_LEVELS.PSL_NAME = FORMMAIN_1678.FIELD0004
LEFT JOIN PERSON_MEMBER_MAP ON PERSON_MEMBER_MAP.MEMBER_ID = ORG_MEMBER."ID"
WHERE ORG_MEMBER.CODE IS NOT NULL AND FORMMAIN_1678.FIELD0006 != '13' AND FORMMAIN_1678.FIELD0006 != '14' AND ORG_MEMBER.IS_DELETED = 0 AND (
FORMMAIN_1678.FIELD0003 != ORG_MEMBER."NAME" OR 
(CASE WHEN FORMMAIN_1678.FIELD0005 = '2' THEN '1' ELSE '0' END) != ORG_MEMBER.IS_ENABLE OR 
ORG_UNIT."ID" != ORG_MEMBER.ORG_DEPARTMENT_ID  OR
ORG_POST."ID" != ORG_MEMBER.ORG_POST_ID 
) 